<template>
	<transition 
		name="page-transition" 
		mode="out-in"
		:duration="{ enter: 300, leave: 300 }"
	>
		<App/>
	</transition>
</template>

<script>
export default {
	onLaunch() {
		console.log('App Launch')
	},
	onShow() {
		console.log('App Show')
	},
	onHide() {
		console.log('App Hide')
	}
}
</script>

<style>
/* 所有 @import 必须放在最前面 */
@import "@/static/fonts/iconfont.css";
@import "@/uni.scss";

page { 
	background-color: #F8F8F8; 
}

/* 全局页面切换动画 */
.page-transition-enter-active,
.page-transition-leave-active {
	transition: all 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.page-transition-enter-from {
	opacity: 0;
	transform: translateX(16px);
}

.page-transition-leave-to {
	opacity: 0;
	transform: translateX(-16px);
}

.page-transition-enter-to,
.page-transition-leave-from {
	opacity: 1;
	transform: translateX(0);
}

/* 路由视图动画 */
.router-view {
	transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 全局元素动画基础设置 */
* {
	box-sizing: border-box;
}

/* 全局过渡动画优化 */
.fade-enter-active, .fade-leave-active {
	transition: opacity 0.3s ease;
}

.fade-enter-from, .fade-leave-to {
	opacity: 0;
}

.slide-fade-enter-active {
	transition: all 0.25s ease-out;
}

.slide-fade-leave-active {
	transition: all 0.25s cubic-bezier(0.4, 0.0, 0.6, 1);
}

.slide-fade-enter-from,
.slide-fade-leave-to {
	transform: translateX(12px);
	opacity: 0;
}
</style> 